<?php


namespace app\common\model;


class Bank extends BaseModel
{
    protected $name = 'bank';
    protected $createTime = false;
    protected $updateTime = false;
    // 当前数据版本号
    private static $version = '0.0.0';

    /**
     * 银行详情
     * @param $bank_id
     * @return null|static
     * @throws \think\exception\DbException
     */
    public static function detail($bank_id)
    {
        return self::get($bank_id);
    }

    /**
     * 从数据库中获取所有可用银行
     * @return array
     */
    public function getList()
    {
        return self::useGlobalScope(false)->where('status',0)->order('sort desc')->column('id, shortname, name, pinyin,bankid,first', 'id');
    }
}